/*
 *  6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
 *
 *  COPYRIGHT (c) 1989-2007.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id: aio_read.c,v 1.2 2009/01/02 10:04:23 ralf Exp $
 */

#if HAVE_CONFIG_H
#include "config.h"
#endif

#include <aio.h>
#include <aio_misc.h>
#include <errno.h>

#include <rtems/system.h>
#include <rtems/seterr.h>


/*
 *  aio_read
 *
 * Asynchronous read from a file
 *
 *  Input parameters:
 *        aiocbp - asynchronous I/O control block
 *
 *  Output parameters:
 *        -1 - if request could not pe enqueued
 *         0 - otherwise
 */

int
aio_read (struct aiocb *aiocbp)
{
  return (rtems_aio_enqueue_request (aiocbp, LIO_READ) == NULL ? -1 : 0);
}
